﻿using System.Data;

namespace PoliticalClassifier.Support
{
    /// <summary>
    /// IDataSourceConnection provides an API for opening and closing a connection to a data source file.
    /// </summary>
    public interface IDataSourceConnection
    {
        /// <summary>
        /// Opens the given file.
        /// </summary>
        /// <param name="fileName">The path to the file to open.</param>
        /// <param name="loadResults">Any errors or warnings that occured during open.</param>
        /// <returns>Whether or not any errors occured during the open.</returns>
        bool Open(string fileName, IDataSourceLoadResults loadResults);

        /// <summary>
        /// Closes the connection.
        /// </summary>
        void Close();

        /// <summary>
        /// The data set for this connection.
        /// </summary>
        DataSet DataSet { get; }
    }
}
